package Example1;

public class Son extends Parent {

    private static Integer staticVar=200;
    public static String publicStaticVar="子类 public静态变量";
    private double price;
    private String name;

    // 普通代码块(一般用来对普通成员变量初始化)
    {
        System.out.println("子类普通代码块执行了");
        price=30.7f;
        name="自热火锅";
    }

    static {
        System.out.println("看看子类静态变量是否初始化:"+staticVar+", "+publicStaticVar);
        System.out.println("子类静态代码块执行了");
    }

    public Son(){
        System.out.println("子类构造方法执行了");
    }
}
